package com.garrett.demo.sys.controller;

import com.garrett.demo.sys.entity.Account;
import com.garrett.demo.sys.entity.UserInfo;
import com.garrett.demo.sys.service.AccountService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Garrett s.h.xjw@outlook.com
 * @date: 2021/1/29 22:44
 * @version: 1.0
 * @description: 系统授权
 */
@RestController
@RequestMapping("/auth")
@Api(tags = "系统：系统授权接口")
@Slf4j
@RequiredArgsConstructor
public class AuthorizationController {

    private final AccountService accountService;

    @PostMapping("login")
    public UserInfo login(String username, String password){
        UserInfo userInfo = accountService.checkLogin(username, password);

        return userInfo;
    }

}
